#pragma once
#include <memory>
#include "linear_system.h"
#include "discrete_linear_system.h"

namespace auto_ros
{
namespace control
{
class ContinuousLinearSys : public LinearSys
{
public:
	friend class DiscreteLinearSys;
	ContinuousLinearSys(uint state_dim, uint control_dim, uint distur_dim = 0, uint out_dim = 0);
	std::shared_ptr<DiscreteLinearSys> discretization(
		double delta_time, std::string method = "eular", double exact_torrence = 1.0e-9);
	bool discrete(std::shared_ptr<DiscreteLinearSys> dis_sys,
				  const double delta_time, const std::string method = "eular", double exact_torrence = 1.0e-9);
	bool integral(
		const uint segment, const double start_time, const double end_time,
		const Eigen::VectorXd x0, const Eigen::VectorXd u, Eigen::VectorXd &xf, std::string method = "eular"); //integral sys without distur
	bool integral(
		const uint segment, const double start_time, const double end_time,
		const Eigen::VectorXd x0, const Eigen::VectorXd u, const Eigen::VectorXd distur, Eigen::VectorXd &xf,
		std::string method = "eular"); //integral sys with distur
	virtual bool calc_steady_state_ctr(
		const Eigen::VectorXd &distur_ref, const Eigen::VectorXd &y_controlled_ref,
		Eigen::VectorXd &steady_state, Eigen::VectorXd &steady_control);
	virtual bool calc_steady_state_ctr(
		const Eigen::VectorXd &distur_ref, const Eigen::VectorXd &y_controlled_ref,
		Eigen::VectorXd &steady_state, Eigen::VectorXd &steady_control, std::map<std::string, double> other_par_map)
	{
		std::cout << "derived class not implemented" << std::endl;
	}
};
} // namespace control
} // namespace auto_ros